home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / lib / os-probes / mounted / 90linux-distro < prev    next >
Text File  |  2008-12-26  |  4KB  |  129 lines

  1. #!/bin/sh
  2. # Test for linux distributions.
  3. set -e
  4.  
  5. . /usr/share/os-prober/common.sh
  6.  
  7. partition="$1"
  8. dir="$2"
  9. type="$3"
  10.  
  11. # This test is inaccurate, but given separate / and /boot partitions and the
  12. # fact that only some architectures have ld-linux.so, I can't see anything
  13. # better. Make sure this test has a high number so that more accurate tests
  14. # can come first.
  15. # TODO: look for ld-linux.so on arches that have it
  16. if ls $dir/lib/ld*.so* >/dev/null 2>/dev/null; then
  17.     if [ -e "$dir/etc/debian_version" ]; then
  18.         short="Debian"
  19.         long=$(printf "Debian GNU/Linux (%s)\n" "$(cat $dir/etc/debian_version)")
  20.     # RPM derived distributions may also have a redhat-release or
  21.     # mandrake-release, so check their files first.
  22.     elif [ -e "$dir/etc/altlinux-release" ]; then
  23.         short="ALTLinux"
  24.         long=$(cat "$dir/etc/altlinux-release")
  25.     elif [ -e "$dir/etc/magic-release" ]; then
  26.         short="Magic"
  27.         long=$(cat "$dir/etc/magic-release")
  28.     elif [ -e "$dir/etc/blackPanther-release" ]; then
  29.         short="blackPanther"
  30.         long=$(cat "$dir/etc/blackPanther-release")
  31.     elif [ -e "$dir/etc/ark-release" ]; then
  32.         short="Ark"
  33.         long=$(cat "$dir/etc/ark-release")
  34.     elif [ -e "$dir/etc/arch-release" ]; then
  35.         short="Arch"
  36.         long=$(cat "$dir/etc/arch-release")
  37.     elif [ -e "$dir/etc/asplinux-release" ]; then
  38.         short="ASPLinux"
  39.         long=$(cat "$dir/etc/asplinux-release")
  40.     elif [ -e "$dir/etc/lvr-release" ]; then
  41.         short="LvR"
  42.         long=$(cat "$dir/etc/lvr-release")
  43.     elif [ -e "$dir/etc/caos-release" ]; then
  44.         short="cAos"
  45.         long=$(cat "$dir/etc/caos-release")
  46.     elif [ -e "$dir/etc/aurox-release" ]; then
  47.         short="Aurox"
  48.         long=$(cat "$dir/etc/aurox-release")
  49.     elif [ -e "$dir/etc/engarde-release" ]; then
  50.         short="EnGarde"
  51.         long=$(cat "$dir/etc/engarde-release")
  52.     elif [ -e "$dir/etc/vine-release" ]; then
  53.         short="Vine"
  54.         long=$(cat "$dir/etc/vine-release")
  55.     elif [ -e "$dir/etc/whitebox-release" ]; then
  56.         short="WhiteBox"
  57.         long=$(cat "$dir/etc/whitebox-release")
  58.     elif [ -e "$dir/etc/pld-release" ]; then
  59.         short="PLD"
  60.         long=$(cat "$dir/etc/pld-release")
  61.     elif [ -e "$dir/etc/startcom-release" ]; then
  62.         short="StartCom"
  63.         long=$(cat "$dir/etc/startcom-release")
  64.     elif [ -e "$dir/etc/trustix-release" ]; then
  65.         short="Trustix"
  66.         long=$(cat "$dir/etc/trustix-release")
  67.     elif [ -e "$dir/etc/openna-release" ]; then
  68.         short="OpenNA"
  69.         long=$(cat "$dir/etc/openna-release")
  70.     elif [ -e "$dir/etc/conectiva-release" ]; then
  71.         short="Conectiva"
  72.         long=$(cat "$dir/etc/conectiva-release")
  73.     elif [ -e "$dir/etc/mandrake-release" ]; then
  74.         short="Mandrake"
  75.         long=$(cat "$dir/etc/mandrake-release")
  76.     elif [ -e "$dir/etc/fedora-release" ]; then
  77.         short="Fedora"
  78.         long=$(cat "$dir/etc/fedora-release")
  79.     elif [ -e "$dir/etc/redhat-release" ]; then
  80.         short="RedHat"
  81.         long=$(cat "$dir/etc/redhat-release")
  82.     elif [ -e "$dir/etc/SuSE-release" ]; then
  83.         short="SuSE"
  84.         long=$(head -n 1 "$dir/etc/SuSE-release")
  85.     elif [ -e "$dir/etc/gentoo-release" ]; then
  86.         short="Gentoo"
  87.         long=$(cat "$dir/etc/gentoo-release")
  88.     elif [ -e "$dir/etc/cobalt-release" ]; then
  89.         short="Cobalt"
  90.         long=$(cat "$dir/etc/cobalt-release")
  91.     elif [ -e "$dir/etc/yellowdog-release" ]; then
  92.         short="YellowDog"
  93.         long=$(cat "$dir/etc/yellowdog-release")
  94.     elif [ -e "$dir/etc/turbolinux-release" ]; then
  95.         short="Turbolinux"
  96.         long=$(cat "$dir/etc/turbolinux-release")
  97.     elif [ -e "$dir/etc/pardus-release" ]; then
  98.         short="Pardus"
  99.         long=$(cat "$dir/etc/pardus-release")
  100.     elif [ -e "$dir/etc/kanotix-version" ]; then
  101.         short="Kanotix"
  102.         long=$(cat "$dir/etc/kanotix-version")
  103.     elif [ -e "$dir/etc/slackware-version" ]; then
  104.         short="Slackware"
  105.         long=$(printf "Slackware Linux (%s)\n" "$(cat $dir/etc/slackware-version)")
  106.     elif [ -e "$dir/sbin/pkgtool" ]; then
  107.         short="Slackware"
  108.         long="Slackware Linux"
  109.     elif grep -qs OpenLinux "$dir/etc/issue"; then
  110.         short="Caldera"
  111.         long="Caldera OpenLinux"
  112.     elif [ -e "$dir/etc/frugalware-release" ]; then
  113.         short="Frugalware Linux"
  114.         long=$(cat "$dir/etc/frugalware-release")
  115.     elif [ -e "$dir/etc/kdemar-release" ]; then
  116.         short="K-DEMar"
  117.         long=$(printf "K-DEMar GNU/Linux (%s)\n" "$(cat $dir/etc/kdemar-release)")
  118.     else
  119.         short="Linux"
  120.         long="unknown Linux distribution"
  121.     fi
  122.     
  123.         label=$(count_next_label $short)
  124.     result "$partition:$long:$label:linux"
  125.     exit 0
  126. else
  127.     exit 1
  128. fi
  129.